﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public void MapFSSTUELI(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
   
        public void SaveFSSTUELI(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryFSSTUELI(dwData, 1);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapFSSTUELI(ref dwLocal, dwData);

            if (!flgExist)
            {
                InsertFSSTUELI(dwLocal);
            }
            UpdateFSSTUELI(dwLocal);
        }
        public void InsertFSSTUELI(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO FSSTUELI(FSSMANDANT, FSSART, FSSPOS, FSSAENZL, FSSAENB, FSSAEND, FSSNEUB, FSSNEUD, FSSVAR, FSSFARBE, FSSGROE, FSSAUFM, FSSVERP, FSSKONTR, FSSPOSTYP, FSSFKUNDNR, FSSMATKZ, FSSKUNDNR, FSSWERK, FSSABT, FSSMART, FSSMVAR, FSSMFARBE, FSSDESS, FSSCOL, FSSBESCH, FSSMGROE, FSSMAUFM, FSSMVERP, FSSVERBR, FSSVBME, FSSVBGRP, FSSVBFKT, FSSVERL, FSSVBKZ, FSSDKZ, FSSPSEUDO, FSSLO, FSSABRKZ, FSSAUFKZ, FSSMODKZ, FSSZUSCHN, FSSTEXT, FSSREFMOD, FSSRMODPOS, FSSREFART, FSSRARTPOS, FSSSW1, FSSSW2, FSSSW3, FSSSW4, FSSSW5, FSSTVERBR1, FSSTVERBR2, FSSTVERBR3, FSSTVERBR4, FSSTVERBR5, FSSTVERBR6, FSSTVERBR7, FSSTVERBR8, FSSTVERBR9, FSSTVERBR10, FSSTVERBR11, FSSTVERBR12, FSSTVERBR13, FSSTVERBR14, FSSTVERBR15, FSSTVERBR16, FSSTVERBR17, FSSTVERBR18, FSSTVERBR19, FSSTVERBR20, FSSTVERBR21, FSSTVERBR22, FSSTVERBR23, FSSTVERBR24, FSSTVERBR25, FSSTVERBR26, FSSTVERBR27, FSSTVERBR28, FSSTVERBR29, FSSTVERBR30, FSSTVERBR31, FSSTVERBR32, FSSTVERBR33, FSSTVERBR34, FSSTVERBR35, FSSTVERBR36, FSSTVERBR37, FSSTVERBR38, FSSTVERBR39, FSSTVERBR40, FSSTVERBR41, FSSTVERBR42, FSSTVERBR43, FSSTVERBR44, FSSTVERBR45, FSSTVERBR46, FSSTVERBR47, FSSTVERBR48, FSSVKNPOS, FSSPGLKZ, FSSFILLER)"
                + " VALUES (:FSSMANDANT, :FSSART, :FSSPOS, 1, 'INTEXE  ', 20080527, 'INTEXE  ', 20080522, '  ', :FSSFARBE, :FSSGROE, '  ', '   ', ' ', 'M', '        ', :FSSMATKZ, '00000000', '   ', '   ', :FSSMART, :FSSMVAR,:FSSMFARBE, '          ', '          ', '          ', :FSSMGROE, '  ', '   ', :FSSVERBR, :FSSVBME, :FSSVBGRP, '000001000000', :FSSVERL, ' ', ' ', '     ', '  ', 'E', ' ', ' ', ' ', '   ', '                    ', 0, '                    ', 0, ' ', ' ', ' ', ' ', ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ' ', '                                          ')";
            or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
            or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
            or1.Parameters.Add("FSSPOS", OracleType.NVarChar).Value = dwData["FSSPOS"].ToString();
            or1.Parameters.Add("FSSFARBE", OracleType.NVarChar).Value = dwData["FSSFARBE"].ToString();
            or1.Parameters.Add("FSSGROE", OracleType.NVarChar).Value = dwData["FSSGROE"].ToString();
            or1.Parameters.Add("FSSMATKZ", OracleType.NVarChar).Value = dwData["FSSMATKZ"].ToString();
            or1.Parameters.Add("FSSMART", OracleType.NVarChar).Value = dwData["FSSMART"].ToString();
            or1.Parameters.Add("FSSMVAR", OracleType.NVarChar).Value = dwData["FSSMVAR"].ToString();
            or1.Parameters.Add("FSSMFARBE", OracleType.NVarChar).Value = dwData["FSSMFARBE"].ToString();
            or1.Parameters.Add("FSSMGROE", OracleType.NVarChar).Value = dwData["FSSMGROE"].ToString();
            or1.Parameters.Add("FSSVERBR", OracleType.NVarChar).Value = dwData["FSSVERBR"].ToString();
            or1.Parameters.Add("FSSVBME", OracleType.NVarChar).Value = dwData["FSSVBME"].ToString();
            or1.Parameters.Add("FSSVBGRP", OracleType.NVarChar).Value = dwData["FSSVBGRP"].ToString();
            or1.Parameters.Add("FSSVERL", OracleType.NVarChar).Value = dwData["FSSVERL"].ToString();
            Connect2Proxy(or1);
        }
        public void DeleteFSSTUELI(string client, string art, string pos, int option = 1)
        {
            OracleCommand or1 = OracleDB.CreateCommand();

            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FSSTUELI "
                        + " WHERE FSSMANDANT=:FSSMANDANT   AND FSSART=:FSSART and FSSPOS=:FSSPOS   ";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = client;
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = art;
                    or1.Parameters.Add("FSSPOS", OracleType.NVarChar).Value = pos;
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void UpdateFSSTUELI(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    dwData["FSSAENB"] = "ITXAUTO ";
                    or1.CommandText = "UPDATE FSSTUELI SET "
                           + "FSSMANDANT=:FSSMANDANT,"
                           + "FSSART=:FSSART,"
                           + "FSSPOS=:FSSPOS,"
                           + "FSSAENZL=:FSSAENZL,"
                           + "FSSAENB=:FSSAENB,"
                           + "FSSAEND=:FSSAEND,"
                           + "FSSNEUB=:FSSNEUB,"
                           + "FSSNEUD=:FSSNEUD,"
                           + "FSSVAR=:FSSVAR,"
                           + "FSSFARBE=:FSSFARBE,"
                           + "FSSGROE=:FSSGROE,"
                           + "FSSAUFM=:FSSAUFM,"
                           + "FSSVERP=:FSSVERP,"
                           + "FSSKONTR=:FSSKONTR,"
                           + "FSSPOSTYP=:FSSPOSTYP,"
                           + "FSSFKUNDNR=:FSSFKUNDNR,"
                           + "FSSMATKZ=:FSSMATKZ,"
                           + "FSSKUNDNR=:FSSKUNDNR,"
                           + "FSSWERK=:FSSWERK,"
                           + "FSSABT=:FSSABT,"
                           + "FSSMART=:FSSMART,"
                           + "FSSMVAR=:FSSMVAR,"
                           + "FSSMFARBE=:FSSMFARBE,"
                           + "FSSDESS=:FSSDESS,"
                           + "FSSCOL=:FSSCOL,"
                           + "FSSBESCH=:FSSBESCH,"
                           + "FSSMGROE=:FSSMGROE,"
                           + "FSSMAUFM=:FSSMAUFM,"
                           + "FSSMVERP=:FSSMVERP,"
                           + "FSSVERBR=:FSSVERBR,"
                           + "FSSVBME=:FSSVBME,"
                           + "FSSVBGRP=:FSSVBGRP,"
                           + "FSSVBFKT=:FSSVBFKT,"
                           + "FSSVERL=:FSSVERL,"
                           + "FSSVBKZ=:FSSVBKZ,"
                           + "FSSDKZ=:FSSDKZ,"
                           + "FSSPSEUDO=:FSSPSEUDO,"
                           + "FSSLO=:FSSLO,"
                           + "FSSABRKZ=:FSSABRKZ,"
                           + "FSSAUFKZ=:FSSAUFKZ,"
                           + "FSSMODKZ=:FSSMODKZ,"
                           + "FSSZUSCHN=:FSSZUSCHN,"
                           + "FSSTEXT=:FSSTEXT,"
                           + "FSSREFMOD=:FSSREFMOD,"
                           + "FSSRMODPOS=:FSSRMODPOS,"
                           + "FSSREFART=:FSSREFART,"
                           + "FSSRARTPOS=:FSSRARTPOS,"
                           + "FSSSW1=:FSSSW1,"
                           + "FSSSW2=:FSSSW2,"
                           + "FSSSW3=:FSSSW3,"
                           + "FSSSW4=:FSSSW4,"
                           + "FSSSW5=:FSSSW5,"
                           + "FSSTVERBR1=:FSSTVERBR1,"
                           + "FSSTVERBR2=:FSSTVERBR2,"
                           + "FSSTVERBR3=:FSSTVERBR3,"
                           + "FSSTVERBR4=:FSSTVERBR4,"
                           + "FSSTVERBR5=:FSSTVERBR5,"
                           + "FSSTVERBR6=:FSSTVERBR6,"
                           + "FSSTVERBR7=:FSSTVERBR7,"
                           + "FSSTVERBR8=:FSSTVERBR8,"
                           + "FSSTVERBR9=:FSSTVERBR9,"
                           + "FSSTVERBR10=:FSSTVERBR10,"
                           + "FSSTVERBR11=:FSSTVERBR11,"
                           + "FSSTVERBR12=:FSSTVERBR12,"
                           + "FSSTVERBR13=:FSSTVERBR13,"
                           + "FSSTVERBR14=:FSSTVERBR14,"
                           + "FSSTVERBR15=:FSSTVERBR15,"
                           + "FSSTVERBR16=:FSSTVERBR16,"
                           + "FSSTVERBR17=:FSSTVERBR17,"
                           + "FSSTVERBR18=:FSSTVERBR18,"
                           + "FSSTVERBR19=:FSSTVERBR19,"
                           + "FSSTVERBR20=:FSSTVERBR20,"
                           + "FSSTVERBR21=:FSSTVERBR21,"
                           + "FSSTVERBR22=:FSSTVERBR22,"
                           + "FSSTVERBR23=:FSSTVERBR23,"
                           + "FSSTVERBR24=:FSSTVERBR24,"
                           + "FSSTVERBR25=:FSSTVERBR25,"
                           + "FSSTVERBR26=:FSSTVERBR26,"
                           + "FSSTVERBR27=:FSSTVERBR27,"
                           + "FSSTVERBR28=:FSSTVERBR28,"
                           + "FSSTVERBR29=:FSSTVERBR29,"
                           + "FSSTVERBR30=:FSSTVERBR30,"
                           + "FSSTVERBR31=:FSSTVERBR31,"
                           + "FSSTVERBR32=:FSSTVERBR32,"
                           + "FSSTVERBR33=:FSSTVERBR33,"
                           + "FSSTVERBR34=:FSSTVERBR34,"
                           + "FSSTVERBR35=:FSSTVERBR35,"
                           + "FSSTVERBR36=:FSSTVERBR36,"
                           + "FSSTVERBR37=:FSSTVERBR37,"
                           + "FSSTVERBR38=:FSSTVERBR38,"
                           + "FSSTVERBR39=:FSSTVERBR39,"
                           + "FSSTVERBR40=:FSSTVERBR40,"
                           + "FSSTVERBR41=:FSSTVERBR41,"
                           + "FSSTVERBR42=:FSSTVERBR42,"
                           + "FSSTVERBR43=:FSSTVERBR43,"
                           + "FSSTVERBR44=:FSSTVERBR44,"
                           + "FSSTVERBR45=:FSSTVERBR45,"
                           + "FSSTVERBR46=:FSSTVERBR46,"
                           + "FSSTVERBR47=:FSSTVERBR47,"
                           + "FSSTVERBR48=:FSSTVERBR48,"
                           + "FSSVKNPOS=:FSSVKNPOS,"
                           + "FSSPGLKZ=:FSSPGLKZ,"
                           + "FSSFILLER=:FSSFILLER "
                           + " WHERE  "
                           + "  FSSMANDANT=:FSSMANDANT AND FSSART=:FSSART AND FSSPOS=:FSSPOS ";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
                    or1.Parameters.Add("FSSPOS", OracleType.NVarChar).Value = dwData["FSSPOS"].ToString();
                    or1.Parameters.Add("FSSAENZL", OracleType.NVarChar).Value = dwData["FSSAENZL"].ToString();
                    or1.Parameters.Add("FSSAENB", OracleType.NVarChar).Value = dwData["FSSAENB"].ToString();
                    or1.Parameters.Add("FSSAEND", OracleType.NVarChar).Value = dwData["FSSAEND"].ToString();
                    or1.Parameters.Add("FSSNEUB", OracleType.NVarChar).Value = dwData["FSSNEUB"].ToString();
                    or1.Parameters.Add("FSSNEUD", OracleType.NVarChar).Value = dwData["FSSNEUD"].ToString();
                    or1.Parameters.Add("FSSVAR", OracleType.NVarChar).Value = dwData["FSSVAR"].ToString();
                    or1.Parameters.Add("FSSFARBE", OracleType.NVarChar).Value = dwData["FSSFARBE"].ToString();
                    or1.Parameters.Add("FSSGROE", OracleType.NVarChar).Value = dwData["FSSGROE"].ToString();
                    or1.Parameters.Add("FSSAUFM", OracleType.NVarChar).Value = dwData["FSSAUFM"].ToString();
                    or1.Parameters.Add("FSSVERP", OracleType.NVarChar).Value = dwData["FSSVERP"].ToString();
                    or1.Parameters.Add("FSSKONTR", OracleType.NVarChar).Value = dwData["FSSKONTR"].ToString();
                    or1.Parameters.Add("FSSPOSTYP", OracleType.NVarChar).Value = dwData["FSSPOSTYP"].ToString();
                    or1.Parameters.Add("FSSFKUNDNR", OracleType.NVarChar).Value = dwData["FSSFKUNDNR"].ToString();
                    or1.Parameters.Add("FSSMATKZ", OracleType.NVarChar).Value = dwData["FSSMATKZ"].ToString();
                    or1.Parameters.Add("FSSKUNDNR", OracleType.NVarChar).Value = dwData["FSSKUNDNR"].ToString();
                    or1.Parameters.Add("FSSWERK", OracleType.NVarChar).Value = dwData["FSSWERK"].ToString();
                    or1.Parameters.Add("FSSABT", OracleType.NVarChar).Value = dwData["FSSABT"].ToString();
                    or1.Parameters.Add("FSSMART", OracleType.NVarChar).Value = dwData["FSSMART"].ToString();
                    or1.Parameters.Add("FSSMVAR", OracleType.NVarChar).Value = dwData["FSSMVAR"].ToString();
                    or1.Parameters.Add("FSSMFARBE", OracleType.NVarChar).Value = dwData["FSSMFARBE"].ToString();
                    or1.Parameters.Add("FSSDESS", OracleType.NVarChar).Value = dwData["FSSDESS"].ToString();
                    or1.Parameters.Add("FSSCOL", OracleType.NVarChar).Value = dwData["FSSCOL"].ToString();
                    or1.Parameters.Add("FSSBESCH", OracleType.NVarChar).Value = dwData["FSSBESCH"].ToString();
                    or1.Parameters.Add("FSSMGROE", OracleType.NVarChar).Value = dwData["FSSMGROE"].ToString();
                    or1.Parameters.Add("FSSMAUFM", OracleType.NVarChar).Value = dwData["FSSMAUFM"].ToString();
                    or1.Parameters.Add("FSSMVERP", OracleType.NVarChar).Value = dwData["FSSMVERP"].ToString();
                    or1.Parameters.Add("FSSVERBR", OracleType.NVarChar).Value = dwData["FSSVERBR"].ToString();
                    or1.Parameters.Add("FSSVBME", OracleType.NVarChar).Value = dwData["FSSVBME"].ToString();
                    or1.Parameters.Add("FSSVBGRP", OracleType.NVarChar).Value = dwData["FSSVBGRP"].ToString();
                    or1.Parameters.Add("FSSVBFKT", OracleType.NVarChar).Value = dwData["FSSVBFKT"].ToString();
                    or1.Parameters.Add("FSSVERL", OracleType.NVarChar).Value = dwData["FSSVERL"].ToString();
                    or1.Parameters.Add("FSSVBKZ", OracleType.NVarChar).Value = dwData["FSSVBKZ"].ToString();
                    or1.Parameters.Add("FSSDKZ", OracleType.NVarChar).Value = dwData["FSSDKZ"].ToString();
                    or1.Parameters.Add("FSSPSEUDO", OracleType.NVarChar).Value = dwData["FSSPSEUDO"].ToString();
                    or1.Parameters.Add("FSSLO", OracleType.NVarChar).Value = dwData["FSSLO"].ToString();
                    or1.Parameters.Add("FSSABRKZ", OracleType.NVarChar).Value = dwData["FSSABRKZ"].ToString();
                    or1.Parameters.Add("FSSAUFKZ", OracleType.NVarChar).Value = dwData["FSSAUFKZ"].ToString();
                    or1.Parameters.Add("FSSMODKZ", OracleType.NVarChar).Value = dwData["FSSMODKZ"].ToString();
                    or1.Parameters.Add("FSSZUSCHN", OracleType.NVarChar).Value = dwData["FSSZUSCHN"].ToString();
                    or1.Parameters.Add("FSSTEXT", OracleType.NVarChar).Value = dwData["FSSTEXT"].ToString();
                    or1.Parameters.Add("FSSREFMOD", OracleType.NVarChar).Value = dwData["FSSREFMOD"].ToString();
                    or1.Parameters.Add("FSSRMODPOS", OracleType.NVarChar).Value = dwData["FSSRMODPOS"].ToString();
                    or1.Parameters.Add("FSSREFART", OracleType.NVarChar).Value = dwData["FSSREFART"].ToString();
                    or1.Parameters.Add("FSSRARTPOS", OracleType.NVarChar).Value = dwData["FSSRARTPOS"].ToString();
                    or1.Parameters.Add("FSSSW1", OracleType.NVarChar).Value = dwData["FSSSW1"].ToString();
                    or1.Parameters.Add("FSSSW2", OracleType.NVarChar).Value = dwData["FSSSW2"].ToString();
                    or1.Parameters.Add("FSSSW3", OracleType.NVarChar).Value = dwData["FSSSW3"].ToString();
                    or1.Parameters.Add("FSSSW4", OracleType.NVarChar).Value = dwData["FSSSW4"].ToString();
                    or1.Parameters.Add("FSSSW5", OracleType.NVarChar).Value = dwData["FSSSW5"].ToString();
                    or1.Parameters.Add("FSSTVERBR1", OracleType.NVarChar).Value = dwData["FSSTVERBR1"].ToString();
                    or1.Parameters.Add("FSSTVERBR2", OracleType.NVarChar).Value = dwData["FSSTVERBR2"].ToString();
                    or1.Parameters.Add("FSSTVERBR3", OracleType.NVarChar).Value = dwData["FSSTVERBR3"].ToString();
                    or1.Parameters.Add("FSSTVERBR4", OracleType.NVarChar).Value = dwData["FSSTVERBR4"].ToString();
                    or1.Parameters.Add("FSSTVERBR5", OracleType.NVarChar).Value = dwData["FSSTVERBR5"].ToString();
                    or1.Parameters.Add("FSSTVERBR6", OracleType.NVarChar).Value = dwData["FSSTVERBR6"].ToString();
                    or1.Parameters.Add("FSSTVERBR7", OracleType.NVarChar).Value = dwData["FSSTVERBR7"].ToString();
                    or1.Parameters.Add("FSSTVERBR8", OracleType.NVarChar).Value = dwData["FSSTVERBR8"].ToString();
                    or1.Parameters.Add("FSSTVERBR9", OracleType.NVarChar).Value = dwData["FSSTVERBR9"].ToString();
                    or1.Parameters.Add("FSSTVERBR10", OracleType.NVarChar).Value = dwData["FSSTVERBR10"].ToString();
                    or1.Parameters.Add("FSSTVERBR11", OracleType.NVarChar).Value = dwData["FSSTVERBR11"].ToString();
                    or1.Parameters.Add("FSSTVERBR12", OracleType.NVarChar).Value = dwData["FSSTVERBR12"].ToString();
                    or1.Parameters.Add("FSSTVERBR13", OracleType.NVarChar).Value = dwData["FSSTVERBR13"].ToString();
                    or1.Parameters.Add("FSSTVERBR14", OracleType.NVarChar).Value = dwData["FSSTVERBR14"].ToString();
                    or1.Parameters.Add("FSSTVERBR15", OracleType.NVarChar).Value = dwData["FSSTVERBR15"].ToString();
                    or1.Parameters.Add("FSSTVERBR16", OracleType.NVarChar).Value = dwData["FSSTVERBR16"].ToString();
                    or1.Parameters.Add("FSSTVERBR17", OracleType.NVarChar).Value = dwData["FSSTVERBR17"].ToString();
                    or1.Parameters.Add("FSSTVERBR18", OracleType.NVarChar).Value = dwData["FSSTVERBR18"].ToString();
                    or1.Parameters.Add("FSSTVERBR19", OracleType.NVarChar).Value = dwData["FSSTVERBR19"].ToString();
                    or1.Parameters.Add("FSSTVERBR20", OracleType.NVarChar).Value = dwData["FSSTVERBR20"].ToString();
                    or1.Parameters.Add("FSSTVERBR21", OracleType.NVarChar).Value = dwData["FSSTVERBR21"].ToString();
                    or1.Parameters.Add("FSSTVERBR22", OracleType.NVarChar).Value = dwData["FSSTVERBR22"].ToString();
                    or1.Parameters.Add("FSSTVERBR23", OracleType.NVarChar).Value = dwData["FSSTVERBR23"].ToString();
                    or1.Parameters.Add("FSSTVERBR24", OracleType.NVarChar).Value = dwData["FSSTVERBR24"].ToString();
                    or1.Parameters.Add("FSSTVERBR25", OracleType.NVarChar).Value = dwData["FSSTVERBR25"].ToString();
                    or1.Parameters.Add("FSSTVERBR26", OracleType.NVarChar).Value = dwData["FSSTVERBR26"].ToString();
                    or1.Parameters.Add("FSSTVERBR27", OracleType.NVarChar).Value = dwData["FSSTVERBR27"].ToString();
                    or1.Parameters.Add("FSSTVERBR28", OracleType.NVarChar).Value = dwData["FSSTVERBR28"].ToString();
                    or1.Parameters.Add("FSSTVERBR29", OracleType.NVarChar).Value = dwData["FSSTVERBR29"].ToString();
                    or1.Parameters.Add("FSSTVERBR30", OracleType.NVarChar).Value = dwData["FSSTVERBR30"].ToString();
                    or1.Parameters.Add("FSSTVERBR31", OracleType.NVarChar).Value = dwData["FSSTVERBR31"].ToString();
                    or1.Parameters.Add("FSSTVERBR32", OracleType.NVarChar).Value = dwData["FSSTVERBR32"].ToString();
                    or1.Parameters.Add("FSSTVERBR33", OracleType.NVarChar).Value = dwData["FSSTVERBR33"].ToString();
                    or1.Parameters.Add("FSSTVERBR34", OracleType.NVarChar).Value = dwData["FSSTVERBR34"].ToString();
                    or1.Parameters.Add("FSSTVERBR35", OracleType.NVarChar).Value = dwData["FSSTVERBR35"].ToString();
                    or1.Parameters.Add("FSSTVERBR36", OracleType.NVarChar).Value = dwData["FSSTVERBR36"].ToString();
                    or1.Parameters.Add("FSSTVERBR37", OracleType.NVarChar).Value = dwData["FSSTVERBR37"].ToString();
                    or1.Parameters.Add("FSSTVERBR38", OracleType.NVarChar).Value = dwData["FSSTVERBR38"].ToString();
                    or1.Parameters.Add("FSSTVERBR39", OracleType.NVarChar).Value = dwData["FSSTVERBR39"].ToString();
                    or1.Parameters.Add("FSSTVERBR40", OracleType.NVarChar).Value = dwData["FSSTVERBR40"].ToString();
                    or1.Parameters.Add("FSSTVERBR41", OracleType.NVarChar).Value = dwData["FSSTVERBR41"].ToString();
                    or1.Parameters.Add("FSSTVERBR42", OracleType.NVarChar).Value = dwData["FSSTVERBR42"].ToString();
                    or1.Parameters.Add("FSSTVERBR43", OracleType.NVarChar).Value = dwData["FSSTVERBR43"].ToString();
                    or1.Parameters.Add("FSSTVERBR44", OracleType.NVarChar).Value = dwData["FSSTVERBR44"].ToString();
                    or1.Parameters.Add("FSSTVERBR45", OracleType.NVarChar).Value = dwData["FSSTVERBR45"].ToString();
                    or1.Parameters.Add("FSSTVERBR46", OracleType.NVarChar).Value = dwData["FSSTVERBR46"].ToString();
                    or1.Parameters.Add("FSSTVERBR47", OracleType.NVarChar).Value = dwData["FSSTVERBR47"].ToString();
                    or1.Parameters.Add("FSSTVERBR48", OracleType.NVarChar).Value = dwData["FSSTVERBR48"].ToString();
                    or1.Parameters.Add("FSSVKNPOS", OracleType.NVarChar).Value = dwData["FSSVKNPOS"].ToString();
                    or1.Parameters.Add("FSSPGLKZ", OracleType.NVarChar).Value = dwData["FSSPGLKZ"].ToString();
                    or1.Parameters.Add("FSSFILLER", OracleType.NVarChar).Value = dwData["FSSFILLER"].ToString();
                    break;
                case 2:
                    dwData["FSSAENB"] = "ITXAUTO ";
                    or1.CommandText = "UPDATE FSSTUELI SET "
                        + "FSSAENB=:FSSAENB,FSSVERBR=:FSSVERBR "
                        + " WHERE  "
                        + "  FSSMANDANT=:FSSMANDANT AND FSSART=:FSSART AND FSSPOS=:FSSPOS ";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
                    or1.Parameters.Add("FSSPOS", OracleType.NVarChar).Value = dwData["FSSPOS"].ToString();
                    or1.Parameters.Add("FSSVERBR", OracleType.NVarChar).Value = dwData["FSSVERBR"].ToString();
                    or1.Parameters.Add("FSSAENB", OracleType.NVarChar).Value = dwData["FSSAENB"].ToString();
                    break;
                default:
                    break;
            }

            Connect2Proxy(or1);
        }
        public DataSet QueryFSSTUELI(DataRow dwData, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1 = null;
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM FSSTUELI WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT * FROM FSSTUELI  "
                    + " WHERE FSSMANDANT=:FSSMANDANT AND FSSART=:FSSART AND FSSPOS=:FSSPOS";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
                    or1.Parameters.Add("FSSPOS", OracleType.NVarChar).Value = dwData["FSSPOS"].ToString();
                    //FSSMANDANT	FSSART	FSSPOS 
                    break;
                case 2:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT * FROM FSSTUELI  "
                    + " WHERE FSSMANDANT=:FSSMANDANT AND FSSART=:FSSART ";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
                    //FSSMANDANT	FSSART	FSSPOS 
                    break;
                case 3:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT S.*,P.TXTKTEXT,WAUEBM,WAFGRLFD FROM FSSTUELI S  LEFT JOIN TXTIND K ON FSSART||SUBSTR('0000'||FSSPOS,-4)= TRIM(TXTISIND)"
                        + " LEFT JOIN TXTKON P ON TXTKPIND=TXTIPIND  AND TXTKPOS=10"
                        + "  LEFT JOIN WASTAMM ON FSSMART=WAART AND FSSMVAR=WAVAR "
                        + "  WHERE FSSMANDANT=:FSSMANDANT AND FSSART=:FSSART";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
                    //FSSMANDANT	FSSART	FSSPOS 
                    break;
                case 4:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT FSABEZ,M.* FROM FSSTUELI M JOIN  FSSTAMM ON FSSART=FSART"
                    + " WHERE FSSMANDANT=:FSSMANDANT AND FSSMART=:FSSMART ";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSMART", OracleType.NVarChar).Value = dwData["FSSMART"].ToString();
                    break;
                case 5:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT DISTINCT F.* FROM FSSTUELI F JOIN ABPOS ON ABPART=FSSART "
                    + " WHERE ABPMANDANT=:ABPMANDANT AND ABPAUFKRS=:ABPAUFKRS AND ABPAUFLFD=:ABPAUFLFD";
                    or1.Parameters.Add("ABPMANDANT", OracleType.NVarChar).Value = dwData["ABPMANDANT"].ToString();
                    or1.Parameters.Add("ABPAUFKRS", OracleType.NVarChar).Value = dwData["ABPAUFKRS"].ToString();
                    or1.Parameters.Add("ABPAUFLFD", OracleType.NVarChar).Value = dwData["ABPAUFLFD"].ToString();
                    //FSSMANDANT	FSSART	FSSPOS 
                    break;
                case 6:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT S.*,P.TXTKTEXT FROM FSSTUELI  S "
                        +" LEFT JOIN TXTIND K ON FSSART||SUBSTR('0000'||FSSPOS,-4)= TRIM(TXTISIND) LEFT JOIN TXTKON P ON TXTKPIND=TXTIPIND  AND TXTKPOS=10"
                    + " WHERE FSSMANDANT=:FSSMANDANT AND FSSART=:FSSART  AND FSSMART=:FSSMART";
                    or1.Parameters.Add("FSSMANDANT", OracleType.NVarChar).Value = dwData["FSSMANDANT"].ToString();
                    or1.Parameters.Add("FSSART", OracleType.NVarChar).Value = dwData["FSSART"].ToString();
                    or1.Parameters.Add("FSSMART", OracleType.NVarChar).Value = dwData["FSSMART"].ToString();
                    //FSSMANDANT	FSSART	FSSPOS 
                    break;
                case 7:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT DISTINCT FSSZUSCHN,FSSZUSCHN AS FDES FROM FSSTUELI";
                    //FSSMANDANT	FSSART	FSSPOS 
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);

            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "FSSTUELI";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
    }
}
